package zhtt.xml2;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * Created by zhaott on 2018/1/29.
 * 基于xml配置
 */
@Controller
public class LoginController {

    @RequestMapping(value = "/login", method = RequestMethod.GET)
    public String loginPage(String username,String password) {
        System.out.println("username:"+username+"\t password:"+password);
        if(username!=null&&username.equals("admin")){
            return "admin";
        }else if(username!=null&&username.length()>0){
            return "other";
        }
        return "login";
    }
}
